package com.dd.cloud.user.service.pres.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dd.cloud.user.entity.pres.DrugsDirectory;
import com.dd.cloud.user.mapper.pres.DrugsDirectoryMapper;
import com.dd.cloud.user.service.pres.IDrugsDirectoryService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author czg
 * @since 2022-07-26
 */
@Service
public class DrugsDirectoryServiceImpl extends ServiceImpl<DrugsDirectoryMapper, DrugsDirectory> implements IDrugsDirectoryService {

    /**
     * 通过药品名查询药品用量范围
     * @param names
     * @return
     */
    @Override
    public List<DrugsDirectory> getDrugsDirectoryByNames(String names) {
        String[] nameStr = names.split(",");
        QueryWrapper<DrugsDirectory> qw = new QueryWrapper<>();
        qw.lambda().in(DrugsDirectory::getHerbName, nameStr);
        List<DrugsDirectory> list = list(qw);
        return list;
    }
}
